<!DOCTYPE html>
<html>
<head>
  <title>RequestContext.java</title>
  <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
  <link rel='stylesheet' type='text/css' href='../../../../../coverage.css'/>
  <link rel='shortcut icon' type='image/png' href='../../../../../logo.png'/>
  <script type='text/javascript' src='../../../../../coverage.js'></script>
  <script type='text/javascript' src='../../../../../prettify.js'></script>
</head>
<body onload='prettyPrint()'>
  <table cellpadding='0' cellspacing='1'>
    <caption>igraph_client_java/src/main/java/com/taobao/igraph/client/core/RequestContext.java</caption>
    <tr>
      <td class='line'>1</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>package com.taobao.igraph.client.core;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td><pre class='imports prettyprint' onclick='showHideLines(this)'><div>import com.taobao.eagleeye.EagleEye;

import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
</div><span>import ...</span></pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>/**
 * Created by chekong.ygm on 15/10/3.
 */</div><span>/*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>12</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>public class RequestContext {</pre></td>
    </tr>
    <tr>
      <td class='line'>13</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private static final long NS_TO_MS = 1000000L;</pre></td>
    </tr>
    <tr>
      <td class='line'>14</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private static final int MAX_DISPLAY_REQUEST_LENGTH = 1024;</pre></td>
    </tr>
    <tr>
      <td class='line'>15</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public static final String RPC_SEARCHER_NAME = "igraph";</pre></td>
    </tr>
    <tr>
      <td class='line'>16</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public static final String RPC_UPDATER_NAME = "igraph_update";</pre></td>
    </tr>
    <tr>
      <td class='line'>17</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private String serverAddress;</pre></td>
    </tr>
    <tr>
      <td class='line'>18</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private String requestContent;</pre></td>
    </tr>
    <tr>
      <td class='line'>19</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private int responseContentLength;</pre></td>
    </tr>
    <tr>
      <td class='line'>20</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private long queryEncodeStartNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>21</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private long queryEncodeElapsedNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>22</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private boolean isQueryEncodeTimerRunning;</pre></td>
    </tr>
    <tr>
      <td class='line'>23</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private long serverRequestStartNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>24</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private long serverRequestElapsedNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>25</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private boolean isServerRequestTimerRunning;</pre></td>
    </tr>
    <tr>
      <td class='line'>26</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private long responseDecodeStartNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>27</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private long responseDecodeElapsedNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>28</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private boolean isResponseDecodeTimerRunning;</pre></td>
    </tr>
    <tr>
      <td class='line'>29</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l29s0'>    @Getter @Setter</pre></td>
    </tr>
    <tr>
      <td class='line'>30</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private String rpcServiceName = RPC_SEARCHER_NAME;</pre></td>
    </tr>
    <tr>
      <td class='line'>31</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l31s0'>    @Getter @Setter</pre></td>
    </tr>
    <tr>
      <td class='line'>32</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private String rpcMethodName = "";</pre></td>
    </tr>
    <tr>
      <td class='line'>33</td><td class='count'>3</td>
      <td><pre class='prettyprint covered' id='l33s0'>    @Getter @Setter</pre></td>
    </tr>
    <tr>
      <td class='line'>34</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    private boolean traceInHeader = true;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>36</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l36s0'>    public static enum RpcMethodSet {</pre></td>
    </tr>
    <tr>
      <td class='line'>37</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        RDF("RDF"), PG("PG"), CUSTOM("CUSTOM"), COMP("comp"), ATOMIC("atomic"), </pre></td>
    </tr>
    <tr>
      <td class='line'>38</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        SET("SET"), DELETE("DELETE"), UPDATE("UPDATE"), INCREMENT("INCREMENT");</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>40</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        private String value;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>42</td><td class='count'>9</td>
      <td><pre class='prettyprint covered' id='l42s0'>        private RpcMethodSet(String val) {</pre></td>
    </tr>
    <tr>
      <td class='line'>43</td><td class='count'>9</td>
      <td><pre class='prettyprint covered' id='l43s0'>            this.value = val;</pre></td>
    </tr>
    <tr>
      <td class='line'>44</td><td class='count'>9</td>
      <td><pre class='prettyprint covered' id='l44s0'>        }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>46</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        @Override</pre></td>
    </tr>
    <tr>
      <td class='line'>47</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        public String toString() {</pre></td>
    </tr>
    <tr>
      <td class='line'>48</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l48s0'>            return this.value;</pre></td>
    </tr>
    <tr>
      <td class='line'>49</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>50</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    };</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>52</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l52s0'>    public RequestContext() {</pre></td>
    </tr>
    <tr>
      <td class='line'>53</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l53s0'>        clear();</pre></td>
    </tr>
    <tr>
      <td class='line'>54</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l54s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>56</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String getRequestContent() {</pre></td>
    </tr>
    <tr>
      <td class='line'>57</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l57s0'>        return requestContent;</pre></td>
    </tr>
    <tr>
      <td class='line'>58</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>60</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>    <span id='l60s0' title='Executions: 1' class='covered'>protected void setRequestContent(@NonNull String requestContent) {</span></pre></td>
    </tr>
    <tr>
      <td class='line'>61</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l61s0'>        this.requestContent = requestContent;</pre></td>
    </tr>
    <tr>
      <td class='line'>62</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l62s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>64</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public int getResponseContentLength() {</pre></td>
    </tr>
    <tr>
      <td class='line'>65</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l65s0'>        return responseContentLength;</pre></td>
    </tr>
    <tr>
      <td class='line'>66</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>68</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void setResponseContentLength(int responseContentLength) {</pre></td>
    </tr>
    <tr>
      <td class='line'>69</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l69s0'>        this.responseContentLength = responseContentLength;</pre></td>
    </tr>
    <tr>
      <td class='line'>70</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l70s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>72</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String getServerAddress() {</pre></td>
    </tr>
    <tr>
      <td class='line'>73</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l73s0'>        return serverAddress;</pre></td>
    </tr>
    <tr>
      <td class='line'>74</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>76</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>    <span id='l76s0' title='Executions: 1' class='covered'>protected void setServerAddress(@NonNull String serverAddress) {</span></pre></td>
    </tr>
    <tr>
      <td class='line'>77</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l77s0'>        this.serverAddress = serverAddress;</pre></td>
    </tr>
    <tr>
      <td class='line'>78</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l78s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>80</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String getServerIP() {</pre></td>
    </tr>
    <tr>
      <td class='line'>81</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l81s0'>        final String protocol = "http://";</pre></td>
    </tr>
    <tr>
      <td class='line'>82</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l82s0'>        int idx = serverAddress.indexOf(protocol);</pre></td>
    </tr>
    <tr>
      <td class='line'>83</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l83s0' title='Executions: 1' class='covered'>if (idx &lt; 0)</span> <span id='l83s1' title='Executions: 0' class='uncovered'>return "";</span></pre></td>
    </tr>
    <tr>
      <td class='line'>84</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l84s0'>        int portIdx = serverAddress.indexOf(':', idx + protocol.length());</pre></td>
    </tr>
    <tr>
      <td class='line'>85</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l85s0' title='Executions: 1' class='covered'>return portIdx > 0</span> ? <span id='l85s1' title='Executions: 0' class='uncovered'>serverAddress.substring(idx + protocol.length(), portIdx)</span> : <span id='l85s2' title='Executions: 1' class='covered'>"";</span></pre></td>
    </tr>
    <tr>
      <td class='line'>86</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>    /**
     * @return query encode latency in ms
     */</div><span>    /*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>91</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public long getQueryEncodeLatency() {</pre></td>
    </tr>
    <tr>
      <td class='line'>92</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l92s0'>        return queryEncodeElapsedNs / NS_TO_MS;</pre></td>
    </tr>
    <tr>
      <td class='line'>93</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>    /**
     * @return server sendSearchRequest latency in ms
     */</div><span>    /*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>98</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public long getServerRequestLatency() {</pre></td>
    </tr>
    <tr>
      <td class='line'>99</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l99s0'>        return serverRequestElapsedNs / NS_TO_MS;</pre></td>
    </tr>
    <tr>
      <td class='line'>100</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'></td><td>&nbsp;</td>
      <td class='comment' onclick='showHideLines(this)'><div>    /**
     * @return response decode latency in ms
     */</div><span>    /*...*/</span></td>
    </tr>
    <tr>
      <td class='line'>105</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public long getResponseDecodeLatency() {</pre></td>
    </tr>
    <tr>
      <td class='line'>106</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l106s0'>        return responseDecodeElapsedNs / NS_TO_MS;</pre></td>
    </tr>
    <tr>
      <td class='line'>107</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>109</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    @Override</pre></td>
    </tr>
    <tr>
      <td class='line'>110</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String toString() {</pre></td>
    </tr>
    <tr>
      <td class='line'>111</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        String nickRequestContent;</pre></td>
    </tr>
    <tr>
      <td class='line'>112</td><td class='count'>2</td>
      <td><pre class='prettyprint jmp'>        <span id='l112s0' title='Executions: 2' class='covered'>if (requestContent == null)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>113</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l113s0'>            nickRequestContent = null;</pre></td>
    </tr>
    <tr>
      <td class='line'>114</td><td class='count'>2</td>
      <td><pre class='prettyprint jmp'>        <span id='l114s0' title='Executions: 2' class='covered'>}</span> else if (requestContent.length() &lt; MAX_DISPLAY_REQUEST_LENGTH) {</pre></td>
    </tr>
    <tr>
      <td class='line'>115</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l115s0'>            nickRequestContent = requestContent;</pre></td>
    </tr>
    <tr>
      <td class='line'>116</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        } else {</pre></td>
    </tr>
    <tr>
      <td class='line'>117</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l117s0'>            StringBuilder ss = new StringBuilder(MAX_DISPLAY_REQUEST_LENGTH + 100);</pre></td>
    </tr>
    <tr>
      <td class='line'>118</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l118s0'>            ss.append(requestContent.substring(0, MAX_DISPLAY_REQUEST_LENGTH / 2))</pre></td>
    </tr>
    <tr>
      <td class='line'>119</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                    .append(" ... ")</pre></td>
    </tr>
    <tr>
      <td class='line'>120</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                    .append("requestLength=[")</pre></td>
    </tr>
    <tr>
      <td class='line'>121</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                    .append(requestContent.length())</pre></td>
    </tr>
    <tr>
      <td class='line'>122</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                    .append("] ... ")</pre></td>
    </tr>
    <tr>
      <td class='line'>123</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                    .append(requestContent.substring(requestContent.length() - MAX_DISPLAY_REQUEST_LENGTH / 2,</pre></td>
    </tr>
    <tr>
      <td class='line'>124</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                            requestContent.length()));</pre></td>
    </tr>
    <tr>
      <td class='line'>125</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l125s0'>            nickRequestContent = ss.toString();</pre></td>
    </tr>
    <tr>
      <td class='line'>126</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>127</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l127s0'>        return "serverAddress=[" + serverAddress + "], requestContent=[" + nickRequestContent</pre></td>
    </tr>
    <tr>
      <td class='line'>128</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                + "], responseContentLength=[" + responseContentLength + "], queryEncodeLatency=["</pre></td>
    </tr>
    <tr>
      <td class='line'>129</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                + getQueryEncodeLatency() + "], serverRequestLatency=[" + getServerRequestLatency()</pre></td>
    </tr>
    <tr>
      <td class='line'>130</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                + "], responseDecodeLatency=[" + getResponseDecodeLatency() + "]";</pre></td>
    </tr>
    <tr>
      <td class='line'>131</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>133</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public void clear() {</pre></td>
    </tr>
    <tr>
      <td class='line'>134</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l134s0'>        requestContent = null;</pre></td>
    </tr>
    <tr>
      <td class='line'>135</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l135s0'>        responseContentLength = 0;</pre></td>
    </tr>
    <tr>
      <td class='line'>136</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l136s0'>        serverAddress = null;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>138</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l138s0'>        queryEncodeStartNs = 0L;</pre></td>
    </tr>
    <tr>
      <td class='line'>139</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l139s0'>        queryEncodeElapsedNs = 0L;</pre></td>
    </tr>
    <tr>
      <td class='line'>140</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l140s0'>        isQueryEncodeTimerRunning = false;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>142</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l142s0'>        serverRequestStartNs = 0L;</pre></td>
    </tr>
    <tr>
      <td class='line'>143</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l143s0'>        serverRequestElapsedNs = 0L;</pre></td>
    </tr>
    <tr>
      <td class='line'>144</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l144s0'>        isServerRequestTimerRunning = false;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>146</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l146s0'>        responseDecodeStartNs = 0L;</pre></td>
    </tr>
    <tr>
      <td class='line'>147</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l147s0'>        responseDecodeElapsedNs = 0L;</pre></td>
    </tr>
    <tr>
      <td class='line'>148</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l148s0'>        isResponseDecodeTimerRunning = false;</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>150</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l150s0'>        rpcServiceName = RPC_SEARCHER_NAME;</pre></td>
    </tr>
    <tr>
      <td class='line'>151</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l151s0'>        rpcMethodName = "";</pre></td>
    </tr>
    <tr>
      <td class='line'>152</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l152s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>154</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void beginQueryEncode() {</pre></td>
    </tr>
    <tr>
      <td class='line'>155</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l155s0' title='Executions: 1' class='covered'>if (!isQueryEncodeTimerRunning)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>156</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l156s0'>            queryEncodeStartNs = System.nanoTime();</pre></td>
    </tr>
    <tr>
      <td class='line'>157</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l157s0'>            isQueryEncodeTimerRunning = true;</pre></td>
    </tr>
    <tr>
      <td class='line'>158</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>159</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l159s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>161</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void endQueryEncode() {</pre></td>
    </tr>
    <tr>
      <td class='line'>162</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l162s0' title='Executions: 1' class='covered'>if (isQueryEncodeTimerRunning)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>163</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l163s0'>            queryEncodeElapsedNs += System.nanoTime() - queryEncodeStartNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>164</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l164s0'>            isQueryEncodeTimerRunning = false;</pre></td>
    </tr>
    <tr>
      <td class='line'>165</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>166</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l166s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>168</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void beginServerRequest() {</pre></td>
    </tr>
    <tr>
      <td class='line'>169</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l169s0' title='Executions: 1' class='covered'>if (!isServerRequestTimerRunning)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>170</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l170s0'>            serverRequestStartNs = System.nanoTime();</pre></td>
    </tr>
    <tr>
      <td class='line'>171</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l171s0'>            isServerRequestTimerRunning = true;</pre></td>
    </tr>
    <tr>
      <td class='line'>172</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>173</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l173s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>175</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void endServerRequest() {</pre></td>
    </tr>
    <tr>
      <td class='line'>176</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l176s0' title='Executions: 1' class='covered'>if (isServerRequestTimerRunning)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>177</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l177s0'>            serverRequestElapsedNs += System.nanoTime() - serverRequestStartNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>178</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l178s0'>            isServerRequestTimerRunning = false;</pre></td>
    </tr>
    <tr>
      <td class='line'>179</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>180</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l180s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>182</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void beginResponseDecode() {</pre></td>
    </tr>
    <tr>
      <td class='line'>183</td><td class='count'>2</td>
      <td><pre class='prettyprint jmp'>        <span id='l183s0' title='Executions: 2' class='covered'>if (!isResponseDecodeTimerRunning)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>184</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l184s0'>            responseDecodeStartNs = System.nanoTime();</pre></td>
    </tr>
    <tr>
      <td class='line'>185</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l185s0'>            isResponseDecodeTimerRunning = true;</pre></td>
    </tr>
    <tr>
      <td class='line'>186</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>187</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l187s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>189</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    protected void endResponseDecode() {</pre></td>
    </tr>
    <tr>
      <td class='line'>190</td><td class='count'>2</td>
      <td><pre class='prettyprint jmp'>        <span id='l190s0' title='Executions: 2' class='covered'>if (isResponseDecodeTimerRunning)</span> {</pre></td>
    </tr>
    <tr>
      <td class='line'>191</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l191s0'>            responseDecodeElapsedNs += System.nanoTime() - responseDecodeStartNs;</pre></td>
    </tr>
    <tr>
      <td class='line'>192</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l192s0'>            isResponseDecodeTimerRunning = false;</pre></td>
    </tr>
    <tr>
      <td class='line'>193</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>        }</pre></td>
    </tr>
    <tr>
      <td class='line'>194</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l194s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>196</td><td>&nbsp;</td>
      <td><pre class='comment'>    // because we have to get trace id & rpc id before query encoding</pre></td>
    </tr>
    <tr>
      <td class='line'>197</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public void startRpc(boolean autoNewTrace) {</pre></td>
    </tr>
    <tr>
      <td class='line'>198</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l198s0' title='Executions: 1' class='covered'>if (EagleEye.getTraceId() == null</span> && <span id='l198s1' title='Executions: 1' class='covered'>!autoNewTrace)</span> </pre></td>
    </tr>
    <tr>
      <td class='line'>199</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l199s0'>            return ;</pre></td>
    </tr>
    <tr>
      <td class='line'>200</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l200s0'>        EagleEye.startRpc(rpcServiceName, rpcMethodName);</pre></td>
    </tr>
    <tr>
      <td class='line'>201</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l201s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>203</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public void endRpc(boolean success) {</pre></td>
    </tr>
    <tr>
      <td class='line'>204</td><td>&nbsp;</td>
      <td><pre class='comment'>        // EagleEye will ignore if getTraceId() == null</pre></td>
    </tr>
    <tr>
      <td class='line'>205</td><td class='count'>1</td>
      <td><pre class='prettyprint jmp'>        <span id='l205s0' title='Executions: 1' class='covered'>EagleEye.rpcClientRecv(success</span> ? <span id='l205s1' title='Executions: 1' class='covered'>EagleEye.RPC_RESULT_SUCCESS</span> : <span id='l205s2' title='Executions: 0' class='uncovered'>EagleEye.RPC_RESULT_FAILED,</span> </pre></td>
    </tr>
    <tr>
      <td class='line'>206</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>                EagleEye.TYPE_SEARCH);</pre></td>
    </tr>
    <tr>
      <td class='line'>207</td><td class='count'>1</td>
      <td><pre class='prettyprint covered' id='l207s0'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>209</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String getTraceId() {</pre></td>
    </tr>
    <tr>
      <td class='line'>210</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l210s0'>        String traceId = EagleEye.getTraceId();</pre></td>
    </tr>
    <tr>
      <td class='line'>211</td><td class='count'>2</td>
      <td><pre class='prettyprint jmp'>        <span id='l211s0' title='Executions: 2' class='covered'>return traceId == null</span> ? <span id='l211s1' title='Executions: 2' class='covered'>""</span> : <span id='l211s2' title='Executions: 0' class='uncovered'>traceId;</span></pre></td>
    </tr>
    <tr>
      <td class='line'>212</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>214</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String getRpcId() {</pre></td>
    </tr>
    <tr>
      <td class='line'>215</td><td class='count'>2</td>
      <td><pre class='prettyprint covered' id='l215s0'>        String rpcId = EagleEye.getRpcId();</pre></td>
    </tr>
    <tr>
      <td class='line'>216</td><td class='count'>2</td>
      <td><pre class='prettyprint jmp'>        <span id='l216s0' title='Executions: 2' class='covered'>return rpcId == null</span> ? <span id='l216s1' title='Executions: 2' class='covered'>""</span> : <span id='l216s2' title='Executions: 0' class='uncovered'>rpcId;</span></pre></td>
    </tr>
    <tr>
      <td class='line'>217</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr><td class='line'></td><td colspan='2'>&nbsp;</td></tr>
    <tr>
      <td class='line'>219</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    public String getExportedUserData() {</pre></td>
    </tr>
    <tr>
      <td class='line'>220</td><td class='count'>0</td>
      <td><pre class='prettyprint uncovered' id='l220s0'>        String udata = EagleEye.exportUserData();</pre></td>
    </tr>
    <tr>
      <td class='line'>221</td><td class='count'>0</td>
      <td><pre class='prettyprint jmp'>        <span id='l221s0' title='Executions: 0' class='uncovered'>return udata == null</span> ? <span id='l221s1' title='Executions: 0' class='uncovered'>""</span> : <span id='l221s2' title='Executions: 0' class='uncovered'>udata;</span></pre></td>
    </tr>
    <tr>
      <td class='line'>222</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>    }</pre></td>
    </tr>
    <tr>
      <td class='line'>223</td><td>&nbsp;</td>
      <td><pre class='prettyprint'>}</pre></td>
    </tr>
  </table>
</body>
</html>
